package com.symaster.backups.repository;

import com.symaster.backups.model.SystemConfigModel;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.Optional;

/**
 * @author yinmiao
 * @version 2024/2/19
 */
@Repository
public interface SystemConfigRepository extends JpaRepository<SystemConfigModel, Integer> {

    @Query(value = "select * from bk_system_config where config_key = ?1 limit 1", nativeQuery = true)
    Optional<SystemConfigModel> findByKey(String key);
}
